package microsoft

import (
	"context"
	"fmt"
	"github.com/beherochuling/beesoft_api/app/helper/net"
)

func NewEdgeAudio(ctx context.Context) *EdgeAudio {
	return &EdgeAudio{
		ctx: ctx,
	}
}

func (r *EdgeAudio) Token(token string) *EdgeAudio {
	r.token = token

	return r
}

func (r *EdgeAudio) Voices() string {
	uri := fmt.Sprintf("%s%s?trustedclienttoken=%s",
		"https://speech.platform.bing.com/consumer/speech/synthesize",
		"/readaloud/voices/list",
		r.token)

	client := net.NewHttp(r.ctx).SetTimeout(5)

	return client.Get(uri)
}
